package com.zf.yichat.mapper;
import com.zf.yichat.base.FsMapper;
import com.zf.yichat.dto.*;
import com.zf.yichat.model.Packet;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface PacketMapper extends FsMapper<Packet> {

    PacketSendInfoDto selectSendCount(@Param("type") Integer val, @Param("userId") Long userId);

    /**
     * 根据userId查询红包领取信息
     * @param val
     * @param userId
     * @return
     */
    PacketReceiveInfoDto selectReceiveCount(@Param("type") Integer val, @Param("userId") Long userId);

    Long countUserReceiveLuck(@Param("userId") Long userId);

    List<PacketSendListDto> selectSendList(@Param("type") Integer val, @Param("userId") Long userId);

    List<PacketReceiveListDto> selectReceiveList(@Param("type") Integer val, @Param("userId") Long userId);

    Integer countReceiveCount(@Param("packetId") Long packetId);



    /**
     * 根据红包ID查询已领取金额
     * @param packetId
     * @return
     */
    BigDecimal queryReceivedMoney(@Param("packetId") Long packetId);

    /**
     * 查询红包详情（详细版）
     * @param packetId
     * @param userId
     * @return
     */
    PacketInfoDto queryPacketInfoDetails(@Param("packetId") Long packetId, @Param("userId") Long userId);
}